﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Xiaozilang_Ordering_System
{
    public partial class BusinessReviews : Form
    {
        DataTable dt = new DataTable();
        public BusinessReviews()
        {
            InitializeComponent();
        }

        private void BusinessReviews_Load(object sender, EventArgs e)
        {
            //文字背景透明
            lblBSName.BackColor = Color.Transparent;
            lblDiZhi1.BackColor = Color.Transparent;
            lblDiZhi2.BackColor = Color.Transparent;
            lblTel1.BackColor = Color.Transparent;
            lblTel2.BackColor = Color.Transparent;
            //取消自动生成列
            dataGridView1.AutoGenerateColumns = false;
            //商家名字
            lblBSName.Text = client.BSName;
            //地址,电话查询
            string sql1 = string.Format("select BSaddress,BStel from Business  where BSname='{0}'", client.BSName);
            dt = DBHelper.SelectByAdapter(sql1);
            //地址
            lblDiZhi2.Text = dt.Rows[0]["BSaddress"].ToString();
            //电话
            lblTel2.Text = dt.Rows[0]["BStel"].ToString();
            //评论显示
            string sql3 = string.Format("select * from Comment c,Business b where c.BSID=b.BSID and b.BSname='{0}'", client.BSName);
            dt = DBHelper.SelectByAdapter(sql3);
            dataGridView1.DataSource = dt;
        }
    }
}
